package amit.browser;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.SwingConstants;

/**
 * Browser status bar
 * JDIC API demo class.
 * <p> * The class represents a status bar.
 */

class BrowserStatusBar extends Box {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5109114457027366378L;
	
	private JLabel labelStatus, labelDesc;

	/**
	 * Ctor
	 */
	public BrowserStatusBar() {
		super(BoxLayout.X_AXIS);

		Toolkit kit = Toolkit.getDefaultToolkit();
		Dimension screenSize = kit.getScreenSize();

		// Add the JLabel displaying the selected object numbers.
		labelStatus = new JLabel("Status:", SwingConstants.LEADING);
		labelStatus.setPreferredSize(new Dimension(
				(int) (0.7 * screenSize.width), 22));
		labelStatus.setBorder(BorderFactory.createLoweredBevelBorder());
		this.add(labelStatus, null);

		// Add the JLabel displaying the description.
		labelDesc = new JLabel("Description:", SwingConstants.LEADING);
		labelDesc.setPreferredSize(new Dimension((int) (0.3 * screenSize.width),
				22));
		labelDesc.setBorder(BorderFactory.createLoweredBevelBorder());
		this.add(labelDesc, null);
	}

	public String getDesc() {
		return labelDesc.getText();
	}

	public void setDesc(String str) {
		labelDesc.setText(str);
	}

	public String getStatus() {
		return labelStatus.getText();
	}

	public void setStatus(String status) {
		labelStatus.setText(status);
	}
}
